{% extends 'window.twig' %}
{% block body %}
    <div class="admin-main-container">
        <div class="tools auth-botton with-padding btn-control data-view">
            <span class="action-btn">
                <a class="btn btn-default" href="model.field.add?id={{ modelId }}">新 增</a>
                <a class="btn btn-default ajax-post" target-form="ids" href="model.field.enable">启 用</a>
                <a class="btn btn-default ajax-post" target-form="ids" href="model.field.disable">禁 用</a>
                <a class="btn btn-default ajax-post confirm" target-form="ids"  href="model.field.delete">删 除</a>
            </span>
            &nbsp; &nbsp; &nbsp; &nbsp;
            <div class="pull-right">
                <a class="btn btn-info" href="model.list">返回</a>
            </div>
        </div>
        <!-- 数据列表 -->
        <div class="data-table with-padding data-view">
            <table class="table table-bordered table-striped ">
                <thead>
                <tr>
                    <th class="row-selected row-selected"><input class="check-all" data-check=".ids" type="checkbox"></th>
                    <th class="">字段名称</th>
                    <th class="">字段标识</th>
                    <th class="">字段类型</th>
                    <th class="">允许为空</th>
                    <th class="">状态</th>
                    <th class="">系统字段</th>
                    <th style="width: 100px;">操作</th>
                </tr>
                </thead>
                <tbody>
                    {% for m in list %}
                    <tr>
                        <td><input {{ m.is_sys?'disabled="disabled"':'class="ids"' }} type="checkbox" name="id[]" value="{{ m.field_id }}"></td>
                        <td>{{ m.title }}</td>
                        <td>{{ m.identifier }}</td>
                        <td>{{ __FieldTypeName__(m.type) }}</td>
                        <td>{{ m.allow_null ? '是' :'否' }}</td>
                        <td>{{ DataState(m.status) }}</td>
                        <td>{{ m.is_sys ? '系统':'用户' }}</td>
                        <td>
                            {% if m.is_sys != 1 %}
                            <a href="model.field.edit?id={{ m.field_id }}">编辑</a>
                            <a href="model.field.delete?id={{ m.field_id }}" class="confirm ajax-get">删除</a>
                            {% endif %}
                        </td>
                    </tr>
                    {% endfor %}
                </tbody>
            </table>

        </div>
        <div class="page">
            <div class="pager">    </div>    </div>

    </div>
{% endblock %}